#define _CRT_SECURE_NO_WARNINGS 1
#include "test.h"

char* my_strstr(char* str1, char* str2)
{
	assert(str1 && str2);

	if (*str2 == 0)
		return str1;
	else
	{
		char* s1 = nullptr, * s2 = nullptr, * check = str1;
		while (*check)
		{
			s1 = check;
			s2 = str2;

			while (*s1 && *s2 && *s1 == *s2)
			{
				s1++;
				s2++;
			}
			if (*s2 == 0)
				return check;
			check++;
		}
		return nullptr;
	}
}

